package subumbo.micro.controller
{
	import com.google.analytics.GATracker;
	
	import flash.display.DisplayObject;
	
	public class Analytics
	{
		private var _tracker:GATracker;
		
		public function init(stage:DisplayObject, id:String, debug:Boolean=false):void
		{
			_tracker = new GATracker(stage, id, "AS3", debug);
		}
		
		public function trackPage(pageName:String):void
		{
			_tracker.trackPageview(pageName);	
		}
		
		public function trackEvent(category:String, action:String, label:String=null, value:Number=0):void
		{
			_tracker.trackEvent(category, action, label, value);
		}
		
		static private const _instance:Analytics = new Analytics();
		static public function get instance():Analytics
		{
			return _instance;
		}
	}
}